Generating Eecient Stack Code for Java
نویسندگان
چکیده
Optimizing Java byte code is complicated by the fact that it uses a stack-based execution model. Changing the intermediate representation from the stack-based to the register-based one brings the problem of Java byte code optimizations into well-studied domain of compiler optimizations for register-based codes. In this paper we describe the technique to convert a register-based code into the Java byte code. The code generation techniques developed for the stack-based computers are not directly applicable to this problem as the comparative cost of the local memory and stack manipulation instructions in JVM is quite diierent from that in the stack-based computers. Naive verbose translation of the register-based code into the Java byte code produces the code with many redundant store and load instructions. The tool that we have developed allows to remove 90-100 % of the stores to the local (i.e., non-global) variables. It produces the Java byte code that is slightly faster and shorter than the original byte code even when no optimizations except for register allocation are performed on the register-based code.
منابع مشابه
Vmgen | a Generator of Eecient Virtual Machine Interpreters
Machine Interpreters M. Anton Ertl1; ;y, David Gregg2, Andreas Krall1, and Bernd Paysan3 1Institut f ur Computersprachen, Technische Universit at Wien, Argentinierstra e 8, A-1040 Wien, Austria 2Department of Computer Science, Trinity College, Dublin 2, Ireland 3Stockmannstr. 14, D-81477 M unchen, Germany SUMMARY In a virtual machine interpreter, the code for each virtual machine instruction...
متن کاملInterprocedural Analysis for Privileged Code Placement and Tainted Variable Detection
In Java 2 and Microsoft .NET Common Language Runtime (CLR), trusted code has often been programmed to perform accessrestricted operations not explicitly requested by its untrusted clients. Since an untrusted client will be on the call stack when access control is enforced, an access-restricted operation will not succeed unless the client is authorized. To avoid this, a portion of the trusted co...
متن کاملGenerating Network Security Protocol Implementations from Formal Specifications
We describe the Spi2Java code generation tool, which we have developed in an attempt to bridge the gap between formal security protocol specification and executable implementation. Implemented in Prolog, Spi2Java can input a formal security protocol specification in a variation of the Spi Calculus, and generate a Java code implementation of that protocol. Initially we discuss the role of code g...
متن کاملHardware compilation for high performance Java processors
High performance on Java applications running on server and desktop machines requires fast execution of Java bytecodes. Such performance can be achieved by Just-In-Time (JIT) compilers, which translate the stack-based bytecodes into register-based machine code on demand. But one crucial problem in Java JIT compilation is the compilation time, which increases the total execution time of an appli...
متن کاملGenerating Stack-based Access Control Policies
The stack-based access control mechanism plays a fundamental role in the security architecture of Java and Microsoft CLR (common language runtime). It is enforced at runtime by inspecting methods in the current call stack for granted permissions before the program performs safety-critical operations. Although stack inspection is well studied, there is relatively little work on automated generat...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1999